home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
cool
/
ge_cool.lha
/
GE_COOL2.1
/
man
/
oldman3
/
Binary_Node.3T
< prev
next >
Wrap
Text File
|
1992-06-26
|
3KB
|
101 lines
.TH BINARY_NODE
.SH NAME
Binary_Node<Type>\f1 Parameterized binary node class
.SH SYNOPSIS
#include <cool/Binary_Node.h>
.SH DESCRIPTION
The
Binary_Node< Type >
class implements parameterized nodes for binary trees.
This class is privately derived from the
Binary_Node
class that contains left
and right subtree pointers. The
Binary_Node< Type >
class adds a data member of
the required type in the private section. Since the
Binary_Node< Type >
class is
intended for use by the
Binary_Tree< Type >
class, the
Binary_Tree< Type >
class is
declared a friend class.
.SH Base Classes
Binary_Node
.SH Friend Classes
Binary_Tree< Type >
.SH Constructors
.TP
\f3Binary_Node<Type> \f3();\f1
Allocates a binary node with left and right subtree pointers set to
NULL .
.TP
\f3Binary_Node<Type> (const Binary_Node<Type>& bn\f3);\f1
Duplicates the value of another binary node object
bn .
.TP
\f3Binary_Node<Type> \f3(const Type& value\f3);\f1
Allocates a binary node with left and right subtree pointers set to
NULL
and
initializes the value of the node to
value .
.SH Member Functions
.TP
\f3Binary_Node<Type>>>&\f3 operator= (const Binary_Node<Type>& bn\f3);\f1
Overloads the assignment operator to assign the values of the left and right
subtree pointers and to assign the value in
bn
to the binary node object. This
function returns a reference to the updated node.
.TP
inline Type& get () const;
Returns a reference to the value of the data member.
.TP
\f3inline Binary_Node<Type>* \f3get_ltree () const;\f1
Returns a pointer to the left subtree.
.TP
\f3inline Binary_Node<Type>* \f3get_rtree () const;\f1
Returns a pointer to the right subtree.
.TP
inline Boolean is_leaf () const;
Determines if the node is a terminal node by evaluating the left and right
subtree pointers. If both are
NULL ,
this function returns
TRUE ;
otherwise, this
function returns
FALSE .
.TP
\f3inline void set (const Type& value\f3);\f1
Sets the value of the data member in the node to
value .
.TP
\f3inline void set_ltree (Binary_Node<Type>* bn\f3);\f1
Sets the value of the left subtree pointer of the binary node object to
bn .
.TP
\f3inline void set_rtree (Binary_Node<Type>* bn\f3);\f1
Sets the value of the right subtree pointer of the binary node object to
bn .
.SH COPYRIGHT
Copyright (C) 1991 Texas Instruments Incorporated.
Permission is granted to any individual or institution to use, copy, modify,
and distribute this software, provided that this complete copyright and
permission notice is maintained, intact, in all copies and supporting
documentation.
Texas Instruments Incorporated provides this software "as is" without
express or implied warranty.